﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%String basePath = request.getContextPath(); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link type="text/css" rel="stylesheet" media="all"
	href="../../css/global.css" />
<link type="text/css" rel="stylesheet" media="all"
	href="../../css/global_color.css" />
<%@ include file="../header/header_list.jsp"%>
<script src="../../js/jquery-3.3.1.js" type="text/javascript"></script>
<script></script>
<script>
        	$(function(){
        		$("#repwdnew").blur(function(){
        			$("#repwdnew").parent().find(".validate_msg_medium").remove();
        			if($("#pwdnew").val()!=$("#repwdnew").val()){
        				$("#repwdnew").parent().append("<div class='validate_msg_medium'>两次新密码必须相同</div>");
        			}
        		});
        		$("#pwdnew").blur(function(){
        			$("#pwdnew").parent().find(".validate_msg_medium").remove();
        			if($("#pwdnew").val() == $("#pwd").val()){
        				$("#pwdnew").parent().append("<div class='validate_msg_medium'>新密码不能和旧密码相同</div>");
        			}
        		});
        	});
        	
        	function showResult() {
                showResultDiv(true);
                window.setTimeout("showResultDiv(false);", 3000);
            }
            function showResultDiv(flag) {
                var divResult = document.getElementById("save_result_info");
                if (flag)
                    divResult.style.display = "block";
                else
                    divResult.style.display = "none";
            }
        </script>
</head>
<body>
	
	<div id="main">
		<!--保存操作后的提示信息：成功或者失败-->
		<div id="save_result_info" class="save_success">
			<span id="show"></span>
		</div>
		<form class="main_form">
			<div class="text_info clearfix">
				<span>旧密码：</span>
			</div>
			<div class="input_info">
				<input type="password" class="width200" id="pwd" name="pwd1" /><span
					class="required">*</span>
				<!-- <div class="validate_msg_medium">30长度以内的字母、数字和下划线的组合</div> -->
			</div>
			<div class="text_info clearfix">
				<span>新密码：</span>
			</div>
			<div class="input_info">
				<input type="password" class="width200" id="pwdnew" name="pwdnew1" /><span
					class="required">*</span>
				<!-- <div class="validate_msg_medium">30长度以内的字母、数字和下划线的组合</div> -->
			</div>
			<div class="text_info clearfix">
				<span>重复新密码：</span>
			</div>
			<div class="input_info">
				<input type="password" class="width200" id="repwdnew"
					name="repwdnew1" /><span class="required">*</span>
				<!-- <div class="validate_msg_medium">两次新密码必须相同</div> -->
			</div>
			<div class="button_info clearfix">
				<input type="submit" value="保存" id="btn_save" class="btn_save"
					onclick="showResult()" /> <input type="button" value="取消"
					class="btn_save" />
			</div>
		</form>
	</div>


	<!--主要区域结束-->
	<div id="footer"></div>
	<script src="../../js/jquery-3.3.1.js" type="text/javascript"></script>
	<script type="text/javascript">
        $(document).ready(function() {	//定义最后加载
        	$("#btn_save").click(function() {
        		$.ajax({
        			url:'../../AdminModiPwd',
        			type:'GET',
        			data:{"pwd":$("#pwd").val(),"pwdnew":$("#pwdnew").val(),"repwdnew":$("#repwdnew").val()},
        			dataType:"text",  			
        			success:function(result){
        				 $("#show").html(result); 
        				
        			}
        		})
        		
        		 return false; 
    			
    		})
            	
        })  
							
													
	</script>
</body>
</html>
